#ifndef XTANK_H
#define XTANK_H

#include "common.h"

class XObject;
class XGame;

class XTank : public XObject
{
    public:
        XTank(XGame * pGame);
        ~XTank();
        void init(int posx,int posy);
        void draw();
        int process();
        int collisionTest(XObject * pObj);
        OBJECT_TYPE getType() { return OBJ_TANK; }
        
        float angle;

        void speedUp();
        void speedDown();
        void turnToLeft();
        void turnToRight();
        void setNullAccel();

        void setAccelSpeed(int value) { accel_speed=value; }
        void setMaxAccel(int value) { max_accel=(float)value/1000; }
        void setTurnSpeed(int value) { turn_speed=value; }
        void setMaxSpeed(int value) { max_speed=value; }


    private:
        XGame * game;               // pointer to game
        SDL_Surface *image;         // player bitmap

        Uint32 dT;

        int type;                   // Vehicle type
        
        int damage;                 // now vehicle damage
        int armor;                  // now vehicle armor

        float speed;                // now vehicle speed
        float accel;                // uskorenie;

        float xv;
        float yv;

        int max_speed;              // maximum speed
        int max_armor;              // maximum armor
        int max_life;               // naximum life

        float turn_speed;        // speed of rotate
        float accel_speed;
        float max_accel;
};

#endif // XTANK_H
